
// module.exports = {
//   // 前端跨域跨域问题
//   proxyTable: {
//     '/api': { // 使用"/api"来代替"http://f.apiplus.c"
//       target: 'http://localhost:8888/api', // 源地址
//       changeOrigin: true, // 改变源
//       pathRewrite: {
//         '^/api': '' // 路径重写
//       }
//     }
//   }
// }

const webpack = require('webpack')

const path = require('path')
function resolve (dir) {
  return path.join(__dirname, dir)
}

module.exports = {

  configureWebpack: {
    plugins: [
      new webpack.ProvidePlugin({
        $: 'jquery',
        jQuery: 'jquery',
        'window.jQuery': 'jquery',
        Popper: ['popper.js', 'default']
      })
    ]
  },

  lintOnSave: true,
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('assets', resolve('src/assets'))
      .set('components', resolve('src/components'))
      .set('layout', resolve('src/layout'))
      .set('base', resolve('src/base'))
      .set('static', resolve('src/static'))
      .set('vendor', resolve('src/vendor'))
  }

}
